#include<stdio.h>
#include<unistd.h>
#include<sys/shm.h>
#include<string.h>
int main(){
  int shm_id = shmget(0x12121212,1024,IPC_CREAT | 0664);
  if(shm_id < 0){
    perror("shmget");
    return 0;
  }
  void* addr = shmat(shm_id,NULL,0);
  if(addr == NULL){
    perror("shmat");
    return 0;
  }
  printf("shmat addr : %p\n",addr);
  strcpy((char*)addr,"i am process a");
  while(1){
    sleep(1);
  }
  shmdt(addr);
  return 0;
}
